package org.anarcoding.twitterbot.view;

import org.anarcoding.twitterbot.model.AnarcoTwitterBotConf;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class ShlAnarcoTwitterBotConf extends Shell {

	private CmpAnarcoTwitterBotConf	cmpAnarcoTwitterBotConf;

	/**
	 * Launch the application.
	 * 
	 * @param args
	 */

	public static void main( String args[] ) {
		try {
			Display display = Display.getDefault();
			ShlAnarcoTwitterBotConf shell = new ShlAnarcoTwitterBotConf( null );
			shell.open();
			shell.layout();
			while( !shell.isDisposed() ) {
				if( !display.readAndDispatch() ) {
					display.sleep();
				}
			}
		} catch( Exception e ) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the shell.
	 * 
	 * @param display
	 */

	public ShlAnarcoTwitterBotConf( Shell shl ) {
		super( shl, SWT.DIALOG_TRIM );

		cmpAnarcoTwitterBotConf = new CmpAnarcoTwitterBotConf( this, SWT.NONE );
		cmpAnarcoTwitterBotConf.setBounds( 0, 0, 365, 262 );

		createContents();
	}

	/**
	 * Create contents of the shell.
	 */

	protected void createContents() {
		setText( "Bot Conf (favicon ...)" );
		setSize( 371, 287 );

	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}

	public AnarcoTwitterBotConf getAnarcoTwitterBotConf() {
		return cmpAnarcoTwitterBotConf.getNuevaConf();
	}

	public void setAnarcoTwitterBotConf( AnarcoTwitterBotConf nuevaConf ) {
		cmpAnarcoTwitterBotConf.setNuevaConf( nuevaConf );
	}
}
